import unittest
import sys
import time
from datetime import date
from django.test import TestCase

sys.path.append('..')
from wechatApp.models import AccessToken
from wechatApi.token import refreshAccessToken
from wechatApp.wechatToken.token import getToken


class TestWechatApiGetTokenTestCase(TestCase):

	def setUp(self):
		AccessToken.objects.create(accessToken="123",createDate=date.today(),expires=7200)

	def test_getToken(self):
		content=refreshAccessToken()
		print(content)

	def test_getTokenInWebapp(self):
		token=getToken()
	

if __name__ == '__main__':
    unittest.main()